Stockname = char('AAA');
Indexname = char('HNINDEX');
[Stock Index Date PriceStock PriceIndex] = getStock_Index(Stockname,Indexname);

Proc = 1;
datan = x2mdate(Date,0)
datam=datan(262:end)

%Estimation OLS 1Year
[OLS_1Y Ri RI, varben] = MyP1BetaKF(PriceStock, PriceIndex);

[Params ZRi ZRI] = MyKFRunOpt(Ri, RI, Proc);

%kalman Filter Process
theta = Params;
[outkalman] = MyP2BetaKF(theta, Proc, ZRi, ZRI, Ri, varben);
betaKalman_Graph = outkalman(:,8);
ExcelKalman = [datam,betaKalman_Graph];